import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home',
      name: '首页',
      hidden: true,
      icon: 'el-icon-house',
      component: () => import('@/views/layout/Layout'),
      children: [
        {
          path: '/home',
          name: 'HOME',
          hidden: true,
          component: () => import('@/views/home/Home'),
        }
      ]
    },
    {
      path: '/product',
      icon: 'el-icon-film',
      name: '商品管理',
      component: () => import('@/views/layout/Layout'),
      children: [
        {
          path: 'addProduct',
          icon: 'el-icon-sell',
          name: '商品入库',
          component: () => import('@/views/product/AddProduct'),
        },
        {
          path: 'lookProducts',
          icon: 'el-icon-money',
          name: '商品查看',
          component: () => import('@/views/product/LookProducts'),
        },
        {
          path: 'offShelfProducts',
          icon: 'el-icon-sold-out',
          name: '下架商品',
          component: () => import('@/views/product/OffShelf'),
        },
        {
          path: 'genCode',
          icon: 'xt-icon fa fa-qrcode fa-lg',
          name: '条码生成',
          component: () => import('@/views/product/GenCode'),
        }
      ]
    },
    {
      path: '/order',
      icon: 'xt-icon fa fa-users',
      name: '会员管理',
      component: () => import('@/views/layout/Layout'),
      children: [
        {
          path: 'addProduct',
          icon: 'xt-icon fa fa-user-plus',
          name: '增加会员',
          component: () => import('@/views/member/AddMember'),
        },
        {
          path: 'lookProducts',
          icon: 'el-icon-sell',
          name: '会员列表',
          component: () => import('@/views/member/LookMembers'),
        }

      ]
    },
    {
      path: '/order',
      icon: 'el-icon-film',
      name: '订单管理',
      component: () => import('@/views/layout/Layout'),
      children: [
        {
          path: 'ordersList',
          icon: 'el-icon-sell',
          name: '订单查看',
          component: () => import('@/views/orders/LookOrders'),
        }
      ]
    },
    {
      path: '/order',
      icon: 'el-icon-film',
      name: '积分管理',
      component: () => import('@/views/layout/Layout'),
    },
    {
      path: '/user',
      name: '用户',
      // component: () => import('@/views/User'),
    },
    {
      path: '/login',
      name: '用户登录',
      hidden: true,
      component: () => import('@/views/login/Login'),
    },
  ]
})
